package com.gran.mydemo;

import com.replaceapkdemo.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.gran.mydemo.ownui.myactivity.MenuActivity;


public class ShowActivityResult extends MainActivity {
	
	private Intent it=null;
	private String retdata=null;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		
		it=getIntent();
		String recvdata=it.getExtras().getString("data");
		TextView tx=(TextView)findViewById(R.id.showdata);
		tx.setText(recvdata);
		EditText ed=(EditText)findViewById(R.id.returndata);
		retdata=ed.getText().toString();
		
		Button close=(Button)findViewById(R.id.returndata);
		close.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				it.putExtra("data",retdata);
				setResult(2, it);
			}
		});
	}
	
	class OclickReturnDataButton implements OnClickListener{

		@Override
		public void onClick(View v) {
			// TODO Auto-generated method stub
			it.putExtra("data", retdata);
			setResult(2, it);
		}
		
	}
	
}
